{include file="header.tpl"}
<link rel="stylesheet" type="text/css" href="{$base_path}/js/wysiwyg/jquery.wysiwyg.css"  />
<script type="text/javascript" src="{$base_path}/js/wysiwyg/jquery.wysiwyg.js" ></script>
{literal}
<script type="text/javascript">
	$(document).ready(function() {
		$('#wysiwyg').wysiwyg();
		//activePage();
	});
	function activePage(){
		var page = jQuery.url.attr('queryKey')['page'];
		if(page == ''){
			page = 'index.php'
		}else{
			page += '.php';
			//判断是否存在
			//......
		}
		//alert(page);
		return page;
	}
</script>
{/literal}
<!-- CONTENT START -->
<div class="grid_16" id="content">
	<!-- CONTENT TITLE -->
	<div class="grid_9">
		<h1 class="content_edit">Content Editing and Tables</h1>
	</div>
	<!-- CONTENT TITLE RIGHT BOX -->
	<div class="grid_6" id="eventbox">
		<a href="#" class="inline_tip">
			Here would come a small tip of using this admin
		</a>
	</div>
	<div class="clear">
	</div>
	{if $active_sub_menu eq "post_list"}
	<!-- #PORTLETS START -->
	<div id="portlets">
		{if $msg_state neq ""}
		<p class="info" id="{$msg_state}"><span class="info_inner">{$msg}</span></p>
		{/if}

		<!--THIS IS A WIDE PORTLET-->
		<div class="portlet">
				<div class="portlet-header fixed">
					<img src="{$base_path}/images/icons/models.gif"  width="16" height="16" alt="Latest Registered Users" /> Last Registered users Table Example
				</div>
				<div class="portlet-content nopadding">
					<form action="" method="post">
						<table width="100%" cellpadding="0" cellspacing="0" id="box-table-a" summary="Employee Pay Sheet">
							<thead>
								<tr>
									<th width="34" scope="col"><input type="checkbox" name="allbox" id="allbox" onclick="checkAll()" /></th>
									<th width="136" scope="col">Title</th>
									<th width="102" scope="col">Category</th>
									<th width="109" scope="col">Index</th>
									<th width="129" scope="col">Create Date</th>
									<th width="171" scope="col">Update Date</th>
									<th width="123" scope="col">State</th>
									<th width="90" scope="col">Actions</th>
								</tr>
							</thead>
							<tbody>
								{foreach item=item from=$list}
								<tr>
									<td width="34">
									<input type="checkbox" name="" id="" value="{$item.r_id}"/></td>
									<td>{$item.r_title}</td>
									<td>{$item.c_name}</td>
									<td>{$item.r_index}</td>
									<td>{$item.r_crd_date}</td>
									<td>{$item.r_upd_date}</td>
									<td>{$item.r_state}</td>
									<td width="90"><a href="#" class="approve_icon" title="Approve">
										</a>
										<a href="#" class="reject_icon" title="Reject">
										</a>
										<a href="#" class="edit_icon" title="Edit">
										</a>
										<a href="?action=delete&id={$item.r_id}" class="delete_icon" title="Delete">
										</a></td>
								</tr>
								{/foreach}
								<tr class="footer">
									<td colspan="4"><a href="#" class="edit_inline">
											Edit all
										</a>
										<a href="#" class="delete_inline">
											Delete all
										</a>
										<a href="#" class="approve_inline">
											Approve all
										</a>
										<a href="#" class="reject_inline">
											Reject all
										</a></td>
									<td align="right">&nbsp;</td>
									<td colspan="3" align="right"><!--  PAGINATION START  -->
										<div class="pagination">
											<span class="previous-off">&laquo; Previous</span>
											<span class="active">1</span>
											<a href="#" >
												2
											</a>
											<a href="#" >
												3
											</a>
											<a href="#" >
												4
											</a>
											<a href="#" >
												5
											</a>
											<a href="#" >
												6
											</a>
											<a href="#" >
												7
											</a>
											<a href="#"  class="next">
												Next &raquo;
											</a>
										</div>
										<!--  PAGINATION END  --></td>
								</tr>
							</tbody>
						</table>
					</form>
				</div>
		</div>
		<!-- SORTABLE COLUMN START -->
		<div class="clear"></div>
		<div class="column" id="left">
			1
		</div>
		<div class="column">
			2
		</div>
		<!-- SORTABLE COLUMN END -->
	</div>
	<!--  END #PORTLETS -->
	{elseif $active_sub_menu eq "post_edit"}
	<!--    TEXT CONTENT OR ANY OTHER CONTENT START     -->
	<div class="grid_15" id="textcontent">
		{if $msg_state neq ""}
		<p class="info" id="{$msg_state}"><span class="info_inner">{$msg}</span></p>
		{/if}
		
		<form id="edit" action="" method="post" name="post">
			<label>Title</label>
			<input type="text" class="smallInput wide" name="title" />
			<!--WYSIWYG Editor is linked to the textarea with id: #wysiwyg-->
			<label>Edit Content</label>
			<textarea id="wysiwyg" class="smallInput wide" name="content" rows="7" cols="30"></textarea>
			<label>所属模块</label>
			<select class="smallInput" name="unit" disabled="disabled">
	            <option value="">默认选项 (空值)</option>
	            <option value="1" selected="selected">文章</option>
	            <option value="2">模块</option>
	            <option value="3">插件</option>
	            <option value="4">模板</option>
	            <option value="5">菜单</option>
            </select>
			<label>所属分类</label>
			<select class="smallInput" name="cid">
				<option value="">请选择</option>
				{foreach item=item from=$c_list}
				<option value="{$item.c_id}">{$item.c_name}</option>
				{/foreach}
			</select>	
			<div><a class="button" onclick="post.submit();"><span>Submit Post</span></a></div>
		</form>
		<br /><br />
		<div>
			<!-- BUTTONS -->
			<a class="button">
				<span>Submit Form</span>
			</a>
			<a class="button_grey">
				<span>Submit Form</span>
			</a>
			<a class="button_ok">
				<span>Update information</span>
			</a>
			<a class="button_notok">
				<span>Delete this record</span>
			</a>
			<a class="button_grey_round">
				<span>This is a rounded button</span>
			</a>
		</div>
		<div class="clear"></div>
		<br />
		<!--NOTIFICATION MESSAGES-->
		<p class="info" id="success"><span class="info_inner"></span></p>
		<p class="info" id="error"><span class="info_inner"></span></p>
		<p class="info" id="warning"><span class="info_inner"></span></p>
		<p class="info" id="info"><span class="info_inner"></span></p>
	</div>
	<div class="clear">
	</div>
	<!-- END CONTENT-->
	{/if}
</div>
<div class="clear">
</div>
<!-- This contains the hidden content for inline calls -->
<div class='hidden'>
	<div id="inline_example1" title="This is a modal box" style='padding:10px; background:#fff;'>
		<p><strong>This content comes from a hidden element on this page.</strong></p>
		<p><strong>Try testing yourself!</strong></p>
		<p>You can call as many dialogs you want with jQuery UI.</p>
	</div>
</div>
<!--Second hidden element called from the tip message right of the title-->
<div class='hidden'>
	<div id='inline_example2' title="This is a modal" style='padding:10px; background:#fff;'>
		<p><strong>This content comes from the second hidden element on this page.</strong></p>
	</div>
</div>
{include file="footer.tpl"}